package com.it.controller;

import com.alibaba.fastjson.JSON;
import com.it.pojo.MyData;
import com.it.service.impl.ProfileServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Api("展示用户信息，用户填写详细信息")
public class ProfileController {
    @Resource
    ProfileServiceImpl profileService;
    @ApiOperation(value = "展示用户详细信息")
    @RequestMapping(value = "/selOne/{id}")
    public String selOne(@PathVariable Long id){
        MyData myData = profileService.selectByPrimaryKey(id);
        String userJson = JSON.toJSONString(myData);
        return userJson;
    }
    @ApiOperation(value = "用户填写详细信息")
    @RequestMapping(value = "/insertInfo")
    public int insertSelective(MyData record) {
        return profileService.insertSelective(record);
    }
}
